1. Technical Field
The present invention is directed to data processing systems. More specifically, the present invention is directed to a method, apparatus, and computer program product for dynamically modifying the operating parameters of the system, including the processor, memory, and cache, based on the current usage of specialized processing units included in the processor core.
2. Description of Related Art
A symmetric multiprocessing (SMP) data processing system has multiple processors that are symmetric such that each processor has the same processing speed and latency. An SMP system has one operating system that divides the work into tasks that are distributed evenly among the various processors by dispatching one software thread of work to each processor at a time. Thus, a processor in an SMP system executes only one thread at a time.
A simultaneous multi-threading (SMT) data processing system includes multiple processors that can each concurrently execute more than one thread at a time per processor. An SMT system has the ability to favor one thread over another when both threads are running on the same processor.
A processor core includes processing units. Some of the processing units are general purpose units, such as instruction sequencing units and integer units, which are used for general purpose processing. Some of the processing units are special purpose units that are used for specialized processing. For example, a vector multimedia extensions (VMX) unit is a specialized unit that provides vector graphic processing of vectors of floating point values while a different specialized unit, a floating point (FP) unit, provides processing of floating point numbers. There are specialized instructions that take advantage of the functions of the specialized units. When a specialized instruction is executed, a specialized processing unit is used during at least a part of the processing of the instruction to process the instruction.
Each task to be executed by a processor core includes a set of instructions to be executed. When a task is to be executed, a context is created that identifies the instructions in the task as well as the particular specialized units that will be used to execute the instructions of the context. The context is updated based on the detection of the use of these specialized instruction units during execution, with the first execution of an instruction destined to these units setting the use indicator. When a task is switched, the register values and states of the general purpose and specialized units are typically saved. This context may then be retrieved for continued processing at a later time. When the context is retrieved for continued processing, the register values and states of the general purpose and specialized units are restored.
Some operating systems, such as AIX and Linux, are sensitive to the use of these specialized instructions. These known operating systems are aware of which specialized units are needed and used for each context.
Currently, the processing units of a processor may be shared among different tasks. For example, the PowerPC™ utilizes a prefetch unit. The prefetch unit shares prefetch streams between the general purpose units and the specialized processor units, such as the floating point processor and the VMX instruction units. The default sharing assignment typically shares the prefetch unit equally between the general purpose units and the specialized units. Thus, the general purpose units receive 50% and the specialized units receive 50% of the prefetch unit's total time. This allocation of the prefetch unit between general purpose units and specialized units is set regardless of whether or not the task being currently processed uses a specialized unit. Thus, in known systems, the prefetch unit may have 50% of its time allocated to specialized units even though the current task does not use any specialized units.
The manner in which a processing unit is shared among tasks is typically set statically during an initialization process before the system that includes the processing unit begins its normal execution. Once the system is in its normal execution mode after being powered on and booted, the manner in which the unit is shared is not changed dynamically.
Further, the allocation of a processing unit is typically set according to predictions that are made as to what an optimal operating allocation would be. The actual operating conditions do not cause this allocation to change. As described above, a prediction is made based on expected performance that the optimal allocation of a prefetch unit is to have its time allocated equally between the general purpose units and specialized units. The allocation is maintained during execution without regard to the actual operating conditions. For example, as described above, a particular task may not require any specialized units at all. For this particular task, the optimal allocation of the prefetch unit is not the predicted case where the prefetch unit is allocated equally between the general purpose units and the specialized units. During the execution of this particular task, the processor that includes this prefetch unit is not operating in an optimal state.
Another example of where a processor is not operating in an optimal state involves the power supplied to the processing units of the processor. The various units of a processor core have power supplied to them when they are executing instructions. However, there are times when a unit may be sitting idle waiting for useful work to perform. In this case, when a unit is sitting idle waiting for useful work, the unit is consuming power even though the unit is not being used.
The specialized units of a processor are typically turned off until they are needed for a particular task. When they are first needed, the specialized units are then turned on. Once they are turned on, however, they remain on regardless of whether they are still needed. Thus; once a specialized unit is turned on, it remains powered on even if that specialized unit is no longer needed in the execution of any other task. Leaving specialized units powered on even though they are not being used, consumes power unnecessarily and also adds an unnecessary burden to the heat dissipation units of the processor.
Therefore, a need exists for a method, apparatus, and computer program product for dynamically modifying the operating parameters of a processor according to which instructions are currently being executed.